# The base bot class and definitions
# bot objects should extend Bot

class Bot(object):
    
    """
    Base class from which all bot objects are descended
    """
    
    def __init__(self, env):
        
        """
        Initializes a bot object
        
        env is a bot's interface to the world
        it will contain hardware and software events as well as a function to raise events
        (as in affect the outer environment in some way)
        """
        super(Bot, self).__init__()
        self.env = env
        
class EnvironmentInterface(object):
    
    """
    Provides the bot with an interace to its environment
    
    harware_events will contain a list of events with which the game engine
    directly affects the hardware. They can only be generated by the engine
       
    software_events_in provides a queue of incoming software events which
    the bot will deal with using the event handling functions it inherits
    when extending a HasCOPONENT class
    
    software_events_out provides a queue in which a bot exports events to the world
    an example would be a mine exploding and telling the environment it has done so
    raise_event(event) is used to add events to the queue
    
    """
    
    def __init__(self):
        super(EnvironmentInterface, self).__init__()        
        from Queue import Queue
        self.harware_events = []
        self.software_events_in = Queue()
        self.software_events_out = Queue()
        
    def raise_event(self, event):
        self.software_events_out.put(event)